#include "utils.h"

#define PRIME1 33461
#define PRIME2 23833
#define PRIME3 28657
#define MUL1 1867
#define MUL2 2833
#define MUL3 7657

double randm()
{
	static int f1 = MUL1;
	static int f2 = MUL2;
	static int f3 = MUL3;
	f1 = (f1 * MUL1) % PRIME1;
	f2 = (f2 * MUL2) % PRIME2;
	f3 = (f3 * MUL3) % PRIME3;
	return (double)f1 + (double)f2 * 200.0 + (double)f3 * 30000.0;
};

double CRandomValueGen::GetRandomDouble()
{
	return randm();
}

BOOL CRandomValueGen::RandomChoose()
{
	double r = randm();
	return randm() > r;
}